#ifndef QEVENTLABEL_H
#define QEVENTLABEL_H

#include <QLabel>
#include <QPlainTextEdit>

class QEventLabel : public QLabel
{
    Q_OBJECT
private:
    QPoint m_ptPosition;
    bool m_moving;
    bool m_checkMove;
    bool m_checkClick;
    void startMoving() {m_moving = true;}
    void stopMoving() {m_moving = false;}
    bool isMoving() {return m_moving;}
public:
    explicit QEventLabel(QWidget *parent = 0, Qt::WindowFlags f = 0);
    ~QEventLabel();
    void setCheckMove(bool flag) {m_checkMove = flag;}
    void setCheckClick(bool flag) {m_checkClick = flag;}
    void setMessage(QString& msg);
    QPlainTextEdit *m_message;
signals:
    void onClick();
public slots:

protected:
    void mouseReleaseEvent(QMouseEvent *ev);
    virtual void mousePressEvent(QMouseEvent* pe);
    virtual void mouseMoveEvent(QMouseEvent* pe);
    
};

#endif // QEVENTLABEL_H
